<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!--资源获取-->
    <base th:href="|${#request.getContextPath()}/|">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/lib/html5shiv.js"></script>
    <script type="text/javascript" src="static/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="static/lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="static/lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <!--layui-->
    <link rel="stylesheet" type="text/css" href="static/layui/css/layui.css"/>
    <script type="text/javascript" src="static/layui/layui.js"></script>
    <script type="text/javascript" src="static/my/echarts/dist/echarts.js"></script>
    <title>资讯列表</title>
</head>
<body>
<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    首页
    <span class="c-gray en">&gt;</span>
    记账本
    <span class="c-gray en">&gt;</span>
    记账本报表
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    <!--收藏-->
    <a id="djsc" class="btn btn-success radius r " style="line-height:1.6em;margin-top:3px" href="javascript:;"
       title="收藏">
        <i id="sc" class="layui-icon"></i>
    </a>
    <!--收藏-->
</nav>
<div class="layui-row layui-col-space30" style=" padding: 30px;">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
        <legend>生活，柴米油盐</legend>
    </fieldset>
    <form class="layui-form" action="">
        <div class="layui-inline">
            <label class="layui-form-label">时间</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" id="test-limit2" placeholder="yyyy-MM">
            </div>
        </div>
        <input type="radio" name="sex" value="s" title="收入" checked>
        <input type="radio" name="sex" value="z" title="支出" >
        <button class="layui-btn" lay-submit lay-filter="formDemo">确定</button>
    </form>

    <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
    <div id="main"  style="width: 600px;height:400px;"></div>
</div>
<script type="text/javascript" src="static/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="static/my/js/post.js"></script>
<script type="text/javascript" src="static/my/js/util.js"></script>
<script>
    var dates ;
    /*收藏按钮*/
    var ejhref = "acc/accBbhtml";//收藏路径
    var ejhrefname = "记账报表"
    ccscym(ejhref)
    $("#djsc").on("click", function () {
        scym(ejhref, ejhrefname)
    })
    /*收藏按钮*/
    /*时间*/
    layui.use(['form','laydate'], function () {
        var laydate = layui.laydate;
        var form = layui.form;
        //常规用法
        laydate.render({
            elem: '#test-limit2'
            ,type: 'month'
            , value: new Date()

        })
        form.on('submit(formDemo)', function(data){
            bt();
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
        bt()

    })
    /*图表*/

    function bt() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('main'));
        // 指定图表的配置项和数据
        var option = {
            title: {
                text: '各个类型收支情况',
                subtext: '饼图',
                left: 'center'
            },
            tooltip: {
                trigger: 'item'
            },
            legend: {
                orient: 'vertical',
                left: 'left',
            },
            series: [
                {
                    name: '收支来源',
                    type: 'pie',
                    radius: '50%',
                    data: [
                        {value: 1048, name: '搜索引擎'},
                        {value: 735, name: '直接访问'},
                        {value: 580, name: '邮件营销'},
                        {value: 484, name: '联盟广告'},
                        {value: 300, name: '视频广告'}
                    ],
                    emphasis: {
                        itemStyle: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };
        $.ajax({
            url:"acc/tbsx",
            type:"GET",
            async:false,
            data:{
                "time":$("#test-limit2").val(),
                "redio": $('input:radio:checked').val()
            },success:function (res) {
                console.log(res);
                (option.series)[0].data = res;
            }
        })
        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
    }

</script>

<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="static/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="static/lib/datatables/1.10.15/jquery.dataTables.min.js"></script>
<script type="text/javascript">


</script>

</body>
</html>
